package com.learn.serialize;

import java.io.*;

/**
 * TODO: please加入描述
 * @author chenxin
 * @time 2017-01-10-19:35
 */
public class SerialTest {
    public static void main(String[] args) throws Exception {
//        SerialObj obj = new SerialObj();
//        obj.setA(1);
//
//        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("/tmp/test.txt"));
//        oos.writeObject(obj);
//        oos.close();

        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("/tmp/test.txt"));
        SerialObj my = (SerialObj) ois.readObject();
        System.out.println(my);

    }
}
